home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / try_qb / ballpset.bas (.txt) < prev    next >
QuickBASIC Tokenized Source  |  1989-12-04  |  3KB  |  51 lines

  1. GetArraySize
  2. WLeft
  3. WRight
  4. WBottom
  5.     ArraySize
  6. Array
  7. Pattern
  8. StepSize
  9.     StartLoop
  10. Decay
  11. EndLoop
  12. Pause
  13. VLeft
  14. VRight
  15. VBottom
  16. RectHeight
  17.     RectWidth
  18. ByteSize
  19.  Define a viewport and draw a border around it:
  20.  Redefine the coordinates of the viewport with logical
  21.  coordinates: 
  22.  Arrays in program are now dynamic:e
  23.  Calculate the logical coordinates for the top and bottom of a
  24.  rectangle large enough to hold the image that will be drawn
  25.  with CIRCLE and PAINT: 
  26.  Call the GetArraySize function, passing it the rectangle'sn
  27.  logical coordinates:e
  28.  Draw and paint the circle:
  29.  Store the rectangle in Array:
  30.  Draw a box and fill it with a pattern:
  31. Press any key to end
  32.  Initialize loop variables:
  33.  Each time the ball "bounces" (hits the bottom of the
  34.  viewport), the Decay variable gets smaller, making the
  35.  height of the next bounce smaller: 
  36. fff?p
  37.  Stop if a key pressed or if Decay is less than .01:
  38.  Put the image on the screen.  The StepSize offset is
  39.  smaller than the border around the circle, so each time
  40.  the image moves, it erases any traces left from the
  41.  previous PUT (it also erases anything else on the
  42.  screen): 
  43.  Reverse direction:l
  44. GetArraySize
  45.  Map the logical coordinates passed to this function toe
  46.  their physical-coordinate equivalents:t
  47.  Calculate the height and width in pixels of the
  48.  enclosing rectangle: 
  49.  Calculate size in bytes of array:
  50.  Array is integer, so divide bytes by two:
  51.